package com.zhouyu.examplerocketmq.consumer;

import com.zhouyu.examplerocketmq.entity.MessageEntity;
import lombok.extern.log4j.Log4j2;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Service;

/**
 * @Description:消息消费者2
 */
@Service
@Log4j2
@RocketMQMessageListener(topic = "topic-4", consumerGroup = "consuGroup2")
public class MessageConsumer4 implements RocketMQListener<MessageEntity> {
    @Override
    public void onMessage(MessageEntity messageEntity) {
        MessageConsumer4.log.info("收到消息2，messageEntity：{}");
    }
}
